package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author stone
 * @date 2022/08/06 11:39
 */
@RestController
@RequestMapping("user")
public class UserController {

    // 字符串和包装类
    //localhost:8080/user/register1?username=songge&password=niupi&age=40
    @RequestMapping("register1")
    public BaseRespVo register1(String username,String password,Integer age) {
        return BaseRespVo.ok("register1:" + username + "-->" + password + "-->" + age);
    }

    // 字符串和基本类型
    //localhost:8080/user/register2?username=songge&password=niupi
    @RequestMapping("register2")
    public BaseRespVo register2(String username,String password,int age) {
        return BaseRespVo.ok("register2" + username + "-->" + password + "-->" + age);
    }
}
